Multiple simultaneous bin sizes

ABSTRACT

Conflicts between the database-building and traversal phases are resolved by allowing the database bin size to be different from the display bin size. The database bin size is some multiple of the bin display bin size, and when there are multiple display bins in a database bin, each database bin is traversed multiple times for display, and the rasterizer discards primitives outside of the current display bin. This allows a trade off between memory bandwidth consumed for database building and bandwidth consumed for display, particularly when the display traversal is done multiple of times.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a continuation of U.S. patent application Ser. No.10/903,671, filed Jul. 30, 2004 and entitled, “MULTIPLE SIMULTANEOUS BINSIZES” which claims priority from U.S. Provisional Application60/533,813 filed Dec. 31, 2003, the entirety of which are incorporatedby reference for all purposes.

FIELD OF THE INVENTION

The present inventions relate to computer graphics and, moreparticularly, to a computer graphics rendering architecture thatutilizes multiple simultaneous bin sizes.

BACKGROUND AND SUMMARY OF THE INVENTION

Background: 3D Computer Graphics

One of the driving features in the performance of most single-usercomputers is computer graphics. This is particularly important incomputer games and workstations, but is generally very important acrossthe personal computer market.

For some years, the most critical area of graphics development has beenin three-dimensional (“3D”) graphics. The peculiar demands of 3Dgraphics are driven by the need to present a realistic view, on acomputer monitor, of a three-dimensional scene. The pattern written ontothe two-dimensional screen must, therefore, be derived from thethree-dimensional geometries in such a way that the user can easily“see” the three-dimensional scene (as if the screen were merely a windowinto a real three-dimensional scene). This requires extensivecomputation to obtain the correct image for display, taking account ofsurface textures, lighting, shadowing, and other characteristics.

The starting point (for the aspects of computer graphics considered inthe present application) is a three-dimensional scene, with specifiedviewpoint and lighting (etc.). The elements of a 3D scene are normallydefined by sets of polygons (typically triangles), each havingattributes such as color, reflectivity, and spatial location. (Forexample, a walking human, at a given instant, might be translated into afew hundred triangles which map out the surface of the human's body.)Textures are “applied” onto the polygons, to provide detail in thescene. (For example, a flat, carpeted floor will look far more realisticif a simple repeating texture pattern is applied onto it.) Designers usespecialized modelling software tools, such as 3D Studio, to buildtextured polygonal models.

The 3D graphics pipeline consists of two major stages, or subsystems,referred to as geometry and rendering. The geometry stage is responsiblefor managing all polygon activities and for converting three-dimensionalspatial data into a two-dimensional representation of the viewed scene,with properly-transformed polygons. The polygons in thethree-dimensional scene, with their applied textures, must then betransformed to obtain their correct appearance from the viewpoint of themoment; this transformation requires calculation of lighting (andapparent brightness), foreshortening, obstruction, etc.

However, even after these transformations and extensive calculationshave been done, there is still a large amount of data manipulation to bedone: the correct values for EACH PIXEL of the transformed polygons mustbe derived from the two-dimensional representation. (This requires notonly interpolation of pixel values within a polygon, but also correctapplication of properly oriented texture maps.) The rendering stage isresponsible for these activities: it “renders” the two-dimensional datafrom the geometry stage to produce correct values for all pixels of eachframe of the image sequence.

The most challenging 3D graphics applications are dynamic rather thanstatic. In addition to changing objects in the scene, many applicationsalso seek to convey an illusion of movement by changing the scene inresponse to the user's input. Whenever a change in the orientation orposition of the camera is desired, every object in a scene must berecalculated relative to the new view. As can be imagined, a fast-pacedgame needing to maintain a high frame rate will require manycalculations and many memory accesses.

Background: Texturing

There are different ways to add complexity to a 3D scene. Creating moreand more detailed models, consisting of a greater number of polygons, isone way to add visual interest to a scene. However, adding polygonsnecessitates paying the price of having to manipulate more geometry. 3Dsystems have what is known as a “polygon budget,” an approximate numberof polygons that can be manipulated without unacceptable performancedegradation. In general, fewer polygons yield higher frame rates.

The visual appeal of computer graphics rendering is greatly enhanced bythe use of “textures”. A texture is a two-dimensional image which ismapped into the data to be rendered. Textures provide a very efficientway to generate the level of minor surface detail which makes syntheticimages realistic, without requiring transfer of immense amounts of data.Texture patterns provide realistic detail at the sub-polygon level, sothe higher-level tasks of polygon-processing are not overloaded. SeeFoley et al., Computer Graphics: Principles and Practice (2.ed. 1990,corr. 1995), especially at pages 741-744; Paul S. Heckbert,“Fundamentals of Texture Mapping and Image Warping,” Thesis submitted toDept. of EE and Computer Science, University of California, Berkeley,Jun. 17, 1994; Heckbert, “Survey of Computer Graphics,” IEEE ComputerGraphics, November 1986, pp. 56; all of which are hereby incorporated byreference. Game programmers have also found that texture mapping isgenerally a very efficient way to achieve very dynamic images withoutrequiring a hugely increased memory bandwidth for data handling.

A typical graphics system reads data from a texture map, processes it,and writes color data to display memory. The processing may includemipmap filtering which requires access to several maps. The texture mapneed not be limited to colors, but can hold other information that canbe applied to a surface to affect its appearance; this could includeheight perturbation to give the effect of roughness. The individualelements of a texture map are called “texels”.

Awkward side-effects of texture mapping occur unless the renderer canapply texture maps with correct perspective. Perspective-correctedtexture mapping involves an algorithm that translates “texels” (pixelsfrom the bitmap texture image) into display pixels in accordance withthe spatial orientation of the surface. Since the surfaces aretransformed (by the host or geometry engine) to produce a 2D view, thetextures will need to be similarly transformed by a linear transform(normally projective or “affine”). (In conventional terminology, thecoordinates of the object surface, i.e. the primitive being rendered,are referred to as an (s,t) coordinate space, and the map of the storedtexture is referred to a (u,v) coordinate space.) The transformation inthe resulting mapping means that a horizontal line in the (x,y) displayspace is very likely to correspond to a slanted line in the (u,v) spaceof the texture map, and hence many additional reads will occur, due tothe texturing operation, as rendering walks along a horizontal line ofpixels.

One of the requirements of many 3-D graphics applications (especiallygaming applications) is fill and texturing rates. Gaming and DCC(digital content creation) applications use complex textures, and mayoften use multiple textures with a single primitive. (CAD and similarworkstation applications, by contrast, make much less use of textures,and typically use smaller polygons but more of them.) Achieving anadequately high rate of texturing and fill operations requires a verylarge memory bandwidth.

Background: Binning

A tiled, binning, chunking, or bucket rendering architecture is wherethe primitives are sorted into screen regions before they are rendered.This architecture allows all the primitives within a screen region to berendered together to exploit the higher locality of reference to the zand color buffers, thereby allowing more efficient memory usagetypically by using only on-chip memory. This also enables otherwhole-scene rendering opportunities such as deferred-rendering,order-independent transparency, and new types of antialiasing. In thepresent application, “transparent” is used generally to designateanything with alpha <1.

The primitives and state are recorded in a spatial database in memorythat represents the frame being rendered. This is done after any T&Lprocessing so everything is in screen coordinates. Ideally, no renderingoccurs until the frame is complete; however, it will be done early on auser flush if the amount of binned data exceeds a programmable thresholdor if the memory set aside to hold the database is exhausted. While thedatabase for one frame is being constructed, the database for an earlierframe will be rendered.

The screen is divided up into rectangular regions called bins, and eachbin heads a linked list of bin records that hold the state andprimitives that overlap with this bin region. A primitive and itsassociated state may be repeated across several bins. Vertex data isheld separately and is not replicated when a primitive overlaps multiplebins to allow more efficient storage mechanisms to be used. Primitivesare maintained in temporal order within a bin.

Opaque primitives can be rendered in any order and are usually renderedin the order the primitives are submitted. Generally, the depth testensures that the final result is the same. However, different renderingorders of co-planar polygons will give different results.

To render transparent primitives correctly, they need to be drawn eitherin a front-to-back or back-to-front order after all the opaqueprimitives have been rendered. The application sorts the transparentprimitives into order before submitting them for rendering, and thereare two basic algorithms used:

The application can sort the transparent primitives in a manner similarto the Painter's algorithm (an early method for hidden surface removal).There may be no correct rendering order when transparent primitives arecyclically interleaved or penetrated, and in these cases, theapplication would need to clip the primitives against each other togenerate a definitive order.

The application can submit the transparent primitives multiple timeswith a dual depth test to render the transparent surfaces one layer at atime. A layer is the set of farthest transparent primitives (or partsthere of) that are in front of the nearest opaque primitives. After eachlayer is rendered, it is incorporated into the opaque primitives for thenext pass. Subsequent layers move closer to the eye position. Thistechnique is called depth peeling. Alternatively, it can be implementedwith subsequent layers moving farther away from the eye; however, thisrequires a triple depth test and is more expensive to render, but hasthe advantage of terminating early once a certain number of layers hasbeen rendered (extra layers add very little to the fidelity of theimage).

Binning has the following benefits:

Reduces the rendering bandwidth by keeping all the depth and color dataon-chip except for the final write to memory once a bin has beenprocessed. For aliased rendering, the frame buffer bandwidth is,therefore, a constant one-pixel write per frame irrespective of overdrawor the amount of alpha-blending or depth read-modify-write operations.Also, note that in many cases, there is no need to save the depth bufferto memory, thereby halving the bandwidth. For full scene antialiasing(FSAA), this is even more dramatic as approximately 4× more reads andwrites occur while rendering (assuming 4-sample FSAA). The down-samplingalso is done from on-chip memory so the bandwidth demand remains thesame as in the non-FSAA case. Some of these bandwidth savings are lostdue to the bandwidth needed to build and parse the bin data structures,and this will be exacerbated with FSAA as the caches will cover asmaller area of screen (the database will be traversed more times). Theover all bandwidth saving is scene and triangle-size dependent.

Fragment computations or texturing is saved by using deferred rendering.A bin is traversed twice—on the first (but simpler pass), the visibilitybuffer is set up, and no color calculations are done. On the secondpass, only those fragments determined to be visible arerendered—effectively reducing the opaque depth complexity to 1. As mostgames have an average depth complexity >3, this can give up to a 3× ormore boost to the apparent fill rate (depending on the originalprimitive submission order).

Less FSAA work. During the first pass of the deferred renderingoperation, the location of edges (geometric and inferred due topenetrating faces) can be ascertained, and only those sub-tiles holdingedges need to have the multi-sample depth values calculated and thecolor replicated to the covered sample points. This saves cycles toupdate the multi-sample buffers and any program cost for alpha-blending.

Stochastic super sampling FSAA. The contents of a bin are renderedmultiple times with the post-transformed primitives being jittered perpass. This is similar to accumulation buffering at the application levelbut occurs without any application involvement (motion blur and depth offield effects cannot be done). It has superior quality and smallermemory footprint than multi-sample FSAA; however, it is slower as thecolor is computed at each sample point (unlike multi-sample where onecolor per fragment is calculated).

The T&L and rasterisation work proceed in parallel with no fine graindependencies so a bottle neck in one part will not stall the other. Thiswill still happen at frame granularity, but within a frame, the workflow will be much smoother.

Memory footprint can be reduced when the depth buffer does not need tobe saved to memory. With FSAA, the depth and color sample buffers arerarely needed after the filtered color has been determined. Note that asall the memory is virtual, space can be allocated for these buffers (incase of a premature flush), but the demand will only be made on theworking set if a flush occurs. Note that the semantics of OpenGL canmake this hard to use.

Multiple Simultaneous Bin Sizes

In the present inventions, the conflicting requirements between thedatabase-building and traversal (i.e. display) phases are resolved byallowing the database bin size to be different from the display binsize. The database bin size is some multiple of the bin display bin size(now call a sub-bin), and when there are multiple sub-bins in a bin,each bin is traversed multiple times for display, and the rasterizerdiscards primitives outside of the current sub-bin. This allows a tradeoff between memory bandwidth consumed for database building andbandwidth consumed for display, particularly when the display traversalis done multiple of times.

In addition to the above-listed advantages, the disclosed innovations,in various embodiments, also provide one or more of at least thefollowing advantages:

Increased speed.

Increased efficiency.

Allows for tradeoff between memory bandwidth consumed for databasebuilding and bandwidth consumed for display.

Reduces the burden of reading in primitives that will be discarded whenoutside of the current sub-bin with the use of an optional bounding boxper primitive.

BRIEF DESCRIPTION OF THE DRAWINGS

The disclosed inventions will be described with reference to theaccompanying drawings, which show important sample embodiments of theinvention and which are incorporated in the specification hereof byreference, wherein:

FIG. 1 depicts a screen divided into sub-bins.

FIG. 2 depicts a primitive on a screen that is divided into conventionalbins.

FIG. 3 depicts the same primitive on a screen whose bins are furtherdivided into sub-bins.

FIG. 4 is a flowchart of the building database phase of the methods andsystems of the present application.

FIG. 5 is a flowchart of a conventional rendering process.

FIG. 6 is a flowchart of the rendering process utilized by the methodsand systems of the present application.

FIGS. 1A-A, 1A-B, and 1A-C are block diagrams of the P20 corearchitecture.

FIG. 1B is a block diagram of T&L Subsystem 1A100.

FIG. 1C is a block diagram of Binning Subsystem 1A110.

FIG. 1D is a block diagram of WID/Subsystem 1A150.

FIG. 1E is a block diagram of Visibility Subsystem 1A160.

FIG. 1F is a block diagram of the first half of Fragment Subsystem1A170.

FIG. 1G is a block diagram of the second half of Fragment Subsystem1A170.

FIG. 1H is a block diagram of SD Subsystem 1A180.

FIG. 1I is a block diagram of Pixel Subsystem 1A190.

FIG. 1J is an overview of a computer system, with a rendering subsystem,which advantageously incorporates the disclosed graphics architecture.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

The numerous innovative teachings of the present application will bedescribed with particular reference to the presently preferredembodiment (by way of example, and not of limitation).

Multiple Simultaneous Bin Sizes

The database-building and traversal (i.e. display) phases haveconflicting requirements, at least within the bounds of currenttechnology:

For efficient database building, the bin size should be as large aspossible so as to minimize the number of bins a primitive can overlap.Typical screen sizes are 1280×1024 so a single bin this size would beideal from a database-building perspective.

For efficient display, the z and color buffers for a bin must fit inon-chip memory (typically a cache) as the whole purpose is to saveexternal memory bandwidth. The typical on-chip memory budget may besufficient to hold 128×64 pixels, but antialiasing can drop down to32×32 pixels as each pixel now has to hold multiple z and color samples.This translates to 160 to 1280 bins respectively.

A further tension arises to keep the number of bins down as each binrequires some dedicated registers to manage state tracking and updatepointers, and to this end, the number of bins has been limited to amaximum of 256.

These conflicts are resolved by allowing the database bin size to bedifferent from the display bin size. The database bin size is somemultiple of the bin display bin size (now call a sub-bin), and whenthere are multiple sub-bins in a bin, each bin is traversed multipletimes for display, and the rasterizer discards primitives outside of thecurrent sub-bin. This allows a trade off between memory bandwidthconsumed for database building and bandwidth consumed for display,particularly when the display traversal is done multiple of times.

When a sub-bin is smaller than a bin, it is advantageous to make the binsmaller to keep the bandwidth cost of repeated traversal down as asmaller bin will more than likely hold fewer primitives.

The rasterizer is very efficient at discarding primitives that areoutside of the current sub-bin being processed. In order to do this,every new vertex in the primitive needs to be read in, and this costs 16bytes of memory bandwidth. Parameters associated with a vertex are onlyread in later after the primitive (or part of the primitive) has passedvisibility testing. A triangle will, therefore, take between 4+16 and4+16*3 bytes to read in depending on the number of new vertices torepresent it. The initial 4 is the number of bytes a primitive takes tostore in a bin record. It is desirable to reduce the burden of readingin primitives that will be discarded when outside of the currentsub-bin, and to do this, an optional bounding box per primitive has beenadded. This bounding box can be encoded in 4 bytes so at a cost of 8bytes, a primitive can now be tested if it is in the current sub-bin—asaving of 12 to 44 bytes when this test fails or an overhead of 4 byteswhen it passes. This really helps small primitives (that are likely tofail many sub bins) and does not really cost large primitives as theoverhead is usually lost in the bandwidth savings due to rendering beingon-chip.

The main idea is to separate out the size of the bins used to build upthe database from the size of the bins used to display it. The boundingbox test is an obvious way to skip over primitives outside of a sub-bin,but not in a bin, and has many parallels in computer graphics.

FIG. 1 depicts a screen divided into sub-bins. Screen 110 shows asub-bin area 113 that is used for display. Screen 110 also shows a binarea 111 for which a database is built. Linked-list 120 shows a sampleembodiment of the bin records associated with bin area 111. List 130shows a sample embodiment of the information associated with bin recordp of linked-list 120. Vertex buffer 140 shows a sample embodiment of avertex buffer and its correlation to the vertices associated withprimitive 10 of bin record p.

FIG. 2 depicts primitive A on a screen that is divided into conventionalbins. For each bin, there is a separate list showing the primitives thataffect the pixels of that particular bin.

FIG. 3 depicts the same primitive on a screen whose bins are furtherdivided into sub-bins. The lists for the whole bins are still the sameas in the FIG. 2. However, in this example, sub-bins 6 _(A), 6 _(B), 6_(C), and 6 _(D) share the same list that indicates that primitive Adoes not affect any of the sub-bins. Sub-bins 11 _(A), 11B>He, ^(an)d HDalso share the same list even though primitive A only affects subs 11_(A) and 11 _(B) and not sub-bins 11 _(C) and 11 _(D).

FIG. 4 is a flowchart of the building database phase of the methods andsystems of the present application. For each primitive on the screen(step 401), each bin (step 403) must be tested to determine if thepixels of that particular bin are affected by the primitive (step 405).If it is not, the system moves on to test the next bin (back to step403). If it is affected, the system then adds the primitive to thatbin's list (step 407). The system must then determine if the bin justtested is the last bin of the screen (step 409). If it is not, thesystem then moves on to the next bin (back to step 403). If it is thelast bin of the screen, the system moves on to the next primitive (step411). If it is determined that there is another primitive to beprocessed (step 413), the system then moves on to that primitive (backto step 401). If there are no further primitives to be processed, thebuilding database process ends.

FIG. 5 is a flowchart of a conventional rendering process. For each binon the screen, the system gets a primitive from that bin's list (step510). The system then paints the pixels of the bin corresponding to theprimitive (step 520). The system must then determine if the primitivejust rendered was the last primitive on that bin's list (step 530). Ifit is not, the system then renders the next primitive on that bin's list(back to step 510). If it is, the system moves on to the next bin (step540).

FIG. 6 is a flowchart of the rendering process utilized by the methodsand systems of the present application. For each sub-bin (step 610), thesystem gets a primitive from the whole bin's list (step 620). The systemmust then determine if the primitive affects the pixels of thatparticular sub-bin (step 630). If it does not, then the system gets thenext primitive from the whole bin's list (back to step 620). If it does,the system then paints the pixels of the sub-bin corresponding to theprimitive (step 640). The system must then determine if the primitivejust rendered was the last primitive on the whole bin's list (step 650).If it is not, the system moves on to the next primitive on that bin'slist (back to step 620). If it is, the system moves on to the nextsub-bin (step 660).

P20 Architecture

The following description gives details of a sample embodiment of thepreferred rendering accelerator chip (referred to as “P20” in thefollowing document, although not all details may apply to every chiprevision marketed as P20). The following description gives an overviewof the P20 Core Architecture and largely ignores other important partsof P20 such as GPIO and the Memory subsystem.

P20 is an evolutionary step from P10 and extends many of the ideasembodied in P10 to accommodate higher performance and extensions inAPIs, particularly OpenGL 2 and DX9.

The main functional enhancements over P10 are the inclusion of a binningsubsystem and a fragment shader targeted specifically at high levellanguage support.

The P20 architecture is a hybrid design employing fixed-function unitswhere the operations are very well defined and programmable units whereflexibility is needed. No attempt has been made to make it backwardscompatible, and a major rewrite of the driver software is expected. (Thearchitecture will be less friendly towards software—changes in the APIstate will no longer be accomplished by setting one or more mode bits inregisters, but will need a new program to be generated and downloadedwhen state changes. More work is pushed onto software to do infrequentoperations such as aligning stipple or dither patterns when a windowmoves.)

General Performance Goals

The general raw performance goals are:

64 fragment/cycle WID/scissor/area stipple processing;

64 fragments/cycle Z failure (visibility testing);

16 fragments/cycle fill rate at 32 bpp (depth buffered with flat orGouraud shading);

6 fragments/cycle for single texture (trilinear) operations;

3 cycle single pixel Gouraud shaded depth buffered triangle rate;

4-sample multi sample operation basically for free; and

400 MHz operational frequency (This frequency assumes a 0.13 micronprocess. A 200 MHz design speed at 0.18 micron scales by 25% going to a0.15 micron process, and this scales again by 25% going to 0.13according to TSMC).

The architecture has been designed to allow a range of performancetrade-offs to be made, and the first-instantiated version will liesomewhere in the middle of the performance landscape.

Isochronous Operation

Isochronous operation is where some type of rendering is scheduled tooccur at a specific time (such as during frame blanking) and has to bedone then irrespective of what ever other rendering may be in progress.GDI+/Longhorn is introducing this notion to the Windows platform. Thetwo solutions to this problem are to have an independent unit to do thisso the main graphics core does not see these isochronous commands or toallow the graphics core to respond to pre-emptive multitasking.

The first solution sounds the simplest and easiest to implement, andprobably is, if the isochronous stream were limited to simple bits;however, the functionality does not have to grow very much (fonts,lines, stretch blits, color conversion, cubic filtering, videoprocessing, etc.) before this side unit starts to look more and morelike a full graphics core.

The second solution is future proof and may well be more gate-efficientas it reuses resources already needed for other things. However, itrequires an efficient way to context switch, preferably without any hostintervention, and a way to suspend the rasterizer in the middle of aprimitive.

Fast context switching can be achieved by duplicating registers andusing a bit per Tile message to indicate which context should be used ora command to switch sets. This is the fastest method but duplicating allthe registers (and WCS) will be very expensive and sub setting them maynot be very future proof if a register is missed out that turns out tobe needed.

As any context-switchable state flows through into the rasterizer, ofthe pipeline that it goes through is the Context Unit. This unit cachesall context data and maintains a copy in the local memory. A small cacheis needed so that frequently updating values such as mode registers donot cause a significant amount of memory traffic. When a context switchis needed, the cache is flushed, and the new context record read frommemory and converted into a message stream to update downstream units.The message tags will be allocated to allow simple decode and mappinginto the context record for both narrow and wide-message formats. Somespecial cases on capturing the context, as well as restoring it, will beneeded to look after the cases where keyhole loading is used, forexample during program loading.

Context switching the rasterizer part way through a primitive is avoidedby having a second rasterizer dedicated to the isochronous stream. Thissecond rasterizer is limited to just rectangles as this fulfils all theanticipated uses of the isochronous stream. (If the isochronous streamwants to draw lines, for example, then the host software can alwaysdecompose them into tiles and send the tile messages just as if therasterizer had generated them.)

There are some special cases where intermediate values (such as theplane equations) will need to be regenerated, and extra messages will besent following a context switch to force these to occur. Internal statethat is incremented, such as glyph position and line stipple position,needs to be handled separately.

T&L context is saved by the Bin Manager Unit and restored via the GPIOContext Restore Unit. The Bin Manager, Bin Display, Primitive Setup andRasterizer units are saved by the Context Unit and restored via the GPIOContext Restore Unit.

Memory Bandwidth

Memory bandwidth is a crucial design factor, and every effort has beenmade to use the bandwidth effectively; however, there is no substitutefor having sufficient bandwidth in the first place. A simple calculationshows that 32 bits per pixel, Z-buffered, alpha-blended rendering takes16 bytes per fragment so a 16 fragment-per-cycle architecture running at400 MHz needs a memory bandwidth of 102 GB/s. Add in memoryinefficiencies (page breaks, refresh) and video refresh (fairlyinsignificant in comparison to the rendering bandwidth), and thisprobably gets up at 107 GB/s or so. (With an 8-filter pipe system,turning on textures will decrease this figure to approximately 51 GB/sbecause the number of fragments per cycle will halve. Textures can bestored compressed so a 32-bit texture will take one byte of storage sothe increase in bandwidth due to texture fetches will be reduced (5bytes were assumed in the calculations—4 bytes from the high resolutiontexture map per fragment and 4 bytes per four fragments for the lowresolution map)).

The memory options are as follows:

DDR2 SDRAM running at 500 MHz has a peak bandwidth of 16 GB/s when thememory is 128-bits wide, or 32 GB/s when 256-bits wide. There are noreal impediments to using this type of memory, but increasing the widthbeyond 256 bits is not feasible due to pin count and cost.

Embedded DRAM or IT RAM. eRAM is the only technology that can providethese very high bandwidth rates by enabling very wide memoryconfigurations. eRAM comes with a number of serious disadvantages: Thereis a high premium on the cost of the chips as they require moremanufacturing steps (for eDRAM); they are foundry-specific, and withsome foundries, the logic speed suffers. Only a modest amount of eRAM(say 8 MBytes) can fit onto a chip economically. This is far short ofwhat is needed, particularly with higher-resolution and deep-pixeldisplays. eRAM really needs to be used as a cache (so it is back torelying on high locality of reference and reuse of pixel data to give ahigh apparent bandwidth to an economical, external memory system).

Change the rules. If the screen were small enough to fit into an on-chipcache (made from eRAM or more traditional RAM), then most of thisrendering bandwidth will be absorbed internally. Clearly, the screencannot be made small enough or the internal caches big enough, but bysorting the incoming geometry and state into small cache-sized,screen-aligned regions (called bins, buckets, chunks and, confusingly,tiles in the literature) and rendering each bin in turn allow this to beachieved. This is accomplished by spending the memory bandwidth in adifferent way (writing and reading the bin database) so provided thatthe database bandwidth is less than the rendering bandwidth and can beaccommodated by the external memory bandwidth, the goal has beeneffectively achieved.

P20 uses an (optional) binning style architecture together with state ofthe art DDR2 memory to get the desired performance. Binning also offerssome other interesting opportunities that will be described later.

Binning

Binning works by building a spatially-sorted scene description beforerendering to allow the rendering of each region (or bin) to beconstrained to fit in the caches. The building of the bin database forone frame occurs while the previous frame is rendered. (Frame means morethan just the displayed frame. Intermediate ‘frames’, such as generatedby render-to-texture operations, also are included in this definition.Any number of frames may be held in the bin data structures forsubsequent rendering; however, it is normal to buffer only one finaldisplay frame to reserve interactivity and reduce the transport delay inan application or game.)

Binning has the following benefits:

Reduces the rendering bandwidth by keeping all the depth and color dataon-chip except for the final write to memory once a bin has beenprocessed. For aliased rendering, the frame buffer bandwidth is,therefore, a constant one-pixel write per frame irrespective of overdrawor the amount of alpha-blending or depth read-modify-write operations.Also, note that in many cases, there is no need to save the depth bufferto memory, thereby halving the bandwidth. For FSAA, this is even moredramatic as approximately 4× more reads and writes occur while rendering(assuming 4-sample FSAA). The down-sampling also is done from on-chipmemory so the bandwidth demand remains the same as in the non-FSAA case.Some of these bandwidth savings are lost due to the bandwidth needed tobuild and parse the bin data structures, and this will be exacerbatedwith FSAA as the caches will cover a smaller area of screen (thedatabase will be traversed more times). The over all bandwidth saving isscene and triangle-size dependent.

Fragment computations or texturing is saved by using deferred rendering.A bin is traversed twice—on the first (but simpler pass), the visibilitybuffer is set up, and no color calculations are done. On the secondpass, only those fragments determined to be visible arerendered—effectively reducing the opaque depth complexity to 1. As mostgames have an average depth complexity >3, this can give up to a 3× ormore boost to the apparent fill rate (depending on the originalprimitive submission order).

Less FSAA work. During the first pass of the deferred renderingoperation, the location of edges (geometric and inferred due topenetrating faces) can be ascertained, and only those sub-tiles holdingedges need to have the multi-sample depth values calculated and thecolor replicated to the covered sample points. This saves cycles toupdate the multi-sample buffers and any program cost for alpha-blending.

Order Independent Transparency. Each bin region has a pair of binbuffers —one holds the opaque primitives and the other holds thetransparent primitives. After the opaque bin is rendered, thetransparent bin is rendered multiple times until all the transparencylayers have been resolved. The layers are resolved in a back to frontorder, and successive layers touch fewer and fewer fragments.

Stochastic super sampling FSAA. The contents of a bin are renderedmultiple times with the post-transformed primitives being jittered perpass. This is similar to accumulation buffering at the application levelbut occurs without any application involvement (motion blur and depth offield effects cannot be done). It has superior quality and smallermemory footprint than multi-sample FSAA; however, it is slower as thecolor is computed at each sample point (unlike multi-sample where onecolor per fragment is calculated).

The T&L and rasterisation work proceed in parallel with no fine graindependencies so a bottle neck in one part will not stall the other. Thiswill still happen at frame granularity, but within a frame, the workflow will be much smoother.

Memory footprint can be reduced when the depth buffer does not need tobe saved to memory. With FSAA, the depth and color sample buffers arerarely needed after the filtered color has been determined. Note that asall the memory is virtual, space can be allocated for these buffers (incase of a premature flush), but the demand will only be made on theworking set if a flush occurs. Note that the semantics of OpenGL canmake this hard to use.

The bin database holds the post-transformed primitive data and state.Only primitives that have passed clipping and culling will be added tothe database, and great care is taken to ensure this data is held in acompact format with a low build and traversal cost. However, if there isnot enough memory to hold the bin data structures, then two portions ofthe memory are allocated: one for state and primitive information andthe other for vertex data. Both regions can be 256 MB in size. It isunlikely, therefore, that the bins will need to be prematurely flushedbefore all the data has been seen. Reserving such large amounts ofmemory, however, may be problematic in some systems. This memory isvirtual memory. Therefore, in these extreme scenes, performance willgradually degrade (as pages are swapped out of on-card memory), but allthe algorithms and optimizations will continue. Nevertheless, theproblem of running out of memory on the ultra-extreme scenes, or maybebecause less generous state/primitive and vertex buffers have beenallocated, must be addressed.

When the buffers overflow, the scene is effectively rendered in several‘passes’, and the memory footprint savings is lost, but most of thebandwidth savings still remain. For each pass, the results of theprevious pass need to be loaded, and the results of the current passsaved. The rendering bandwidth requirement for the depth and colorbuffers is, therefore, #pixels*((#passes*2)−1)*bytes per pixel for depthand color. Therefore, provided each pass holds a reasonable amount ofgeometry, there is still large savings. Clearly, depth complexity playsan important role in this, but on complex scenes that will overflow thebin data structure buffers, there will usually be high-depth complexity.

When there is premature flushing, the order-independent binning andstochastic super-sampling algorithms break as they rely on having allthe scene present before they start. A premature flush also will disableedge tracking so the correct image will be generated, albeit at a lowerperformance.

A block diagram for the core of P20 is shown in FIG. 1A. Some generalobservations:

General control, register loading, and synchronising internal operationsare all done via the message stream.

The message stream, for the most part, does not carry any vertexparameter data (other than the coordinate data).

The message stream does not carry any pixel data except forupload/download data and fragment coverage data. The private data pathsgive more bandwidth and can be tailored to the specific needs of thesending and receiving units.

The Fragment Subsystem can be thought of as working in parallel but is,in fact, physically connected as a daisy chain to make the physicallayout easier.

GPIO

There are two independent command streams—one servicing the GP stream(for 3D and general 2D commands), and one servicing the Isochronousstream. The isochronous command unit has less functionality as it doesnot need, for example, to support vertex arrays.

GPIO performs the following distinct operations:

Input DMA

The command stream is fetched from memory (host or local as determinedby the page tables) and broken into messages based on the tag format.The message data is padded out to 128 bits, if necessary, with zeros,except for the last 32 bits which are set to floating point 1.0. (Thisallows the short hand formats for vertex parameters to be handledautomatically.) The DMA requests can be queued up in a command FIFO orcan be embedded into the DMA buffer itself, thereby allowinghierarchical DMA (to two levels). The hierarchical DMA is useful topre-assemble common command or message sequences.

Circular Buffers

The circular buffers provide a mechanism whereby P20 can be given workin very small packets without incurring the cost of an escape call tothe operating system. These escape calls are relatively expensive sowork is normally packaged up into large amounts before being given tothe graphics system. This can result in the graphics system being idleuntil enough work has accumulated in a DMA buffer, but not enough tocause it to be dispatched to the obvious detriment of performance. Thecircular buffers are preferably stored in local memory and mapped intothe ICD, and chip resident write pointer registers are updated when workhas been added to the circular buffers (this does not require anyoperating system intervention). When a circular buffer goes empty, thehardware will automatically search the pool of circular buffers for morework and instigate a context switch if necessary.

There are 16 circular buffers, and the command stream is processed in anidentical way to input DMA, including the ability to ‘call’ DMA buffers.

Vertex Arrays

Vertex arrays are a more compact way of holding vertex data and allow alot of flexibility on how the data is laid out in memory. Each elementin the array can hold up to 16 parameters, and each parameter can befrom one to four floats in size. The parameters can be heldconsecutively in memory or held in their own arrays. The vertex elementscan be accessed sequentially or via one or two-index arrays.

Vertex Cache Control for Indexed Arrays

When vertex array elements are accessed via index arrays and the arrayshold lists of primitives (lines, triangles or quads, independent orstrips), then frequently the vertices are meshed in some way that can bediscovered by comparing the indices for the current primitive against arecent history of indices. If a match is found, then the vertex does notneed to be fetched from memory (or indeed processed again in the VertexShading Unit), thus saving the memory bandwidth and processing costs.The 16 most recent indices are held.

Output DMA

The output DMA is mainly used to load data from the core into hostmemory. Typical uses of this are for image upload and returning currentvertex state. The output DMA is initiated via messages that pass throughthe core and arrive via the Host Out Unit. This allows any number ofoutput DMA requests to be queued.

Shadow Cache

The shadow cache will keep a copy of the input command stream in memoryso it can be reused without an explicit copy. This helps caching ofmodels in on-card memory behind the application's back, particularlywhen parts of the model are liable to change.

Format Conversion

The Pack and UnPack units provide programmable support for formatconversion during download and upload of pixel data.

T&L Subsystem

Transform and Lighting Subsystem 1A100 is shown in FIG. 1B.

The main thing to note is that the clipping and culling can be donebefore or after the vertex shading operation depending on GeometryRouter Unit 1B103 setting. Doing the clipping and culling prior to anexpensive shading operation can, in some cases, avoid doing work thatwould be later discarded. A side effect of the cull operation is thatthe face direction is ascertained so only the correct side in two-sidedlighting needs be evaluated. (This is handled automatically and ishidden from the programmer. Silhouette vertices (i.e. those that belongto front and back facing triangles) are processed twice.)

Vertex Parameter Unit 1B1O1's main tasks are to track current parametervalues (for context switching and Get operations), remap inputparameters to the slots a vertex shader has been compiled to expect themin, assist with color material processing, and parameter formatconversion to normalized floating point values.

Vertex Transformation Unit 1B102 transforms the incoming vertex positionusing a 4×4 transformation matrix. This is done as a stand aloneoperation outside of Vertex Shading Unit 1B106 to allow clipping andculling to be done prior to vertex shading.

The Geometry Router Unit IB 103 reorders the pipeline into one of twoorders: Transform→Clipping→Shading→Vertex Generator orTransform→Shading→Clipping→Vertex Generator so that expensive shadingoperations can be avoided on vertices that are not part of visibleprimitives.

Cull Clipping Unit 1B104 calculates the sign of the area of a primitiveand culls it (if so enabled). The primitive is tested against the viewfrustum and (optionally) user-clipping planes and discarded if it isfound to be out of view. In view, primitives pass unchanged. Thepartially in-view primitives are (optionally) guard band-clipped beforebeing submitted for full clipping. The results of the clipping processare the barycentric coordinates for the intermediate vertices.

Vertex Shading Unit IB 106 is where the lighting and texture coordinategeneration are done using a user-defined program. The programs can be1024 instructions long, and conditionals, subroutines, and loops aresupported. The matrices, lighting parameters, etc. are held in a 512Vec4 Coefficient memory. Intermediate results are stored either in a64-deep vec2 memory or an 8-deep scalar memory, providing a total of 136registers. These registers are typeless but are typically used to store36-bit floats. The vertex input consists of 24 Vec4s and are typeless.(One parameter is identified as the trigger parameter, and this is thelast parameter for a vertex.) The vertex results are output as acoordinate and up to 16 Vec4 parameter results. The parameters aretypeless, and their interpretation depends on the program loaded intoFragment Shading Unit IF 171.

Vertices are entered into the double-buffered input registers in roundrobin fashion. When 16 input vertices have been received or an attemptis made to update the program or coefficient memories, the program isrun. Non-unit messages do not usually cause the program to run, but theyare correctly interleaved with the vertex results on output to maintaintemporal ordering.

Vertex Shading Unit IB 106 is implemented as a 16-element SIMD array,with each element (VP) working on a separate vertex. Each VP consists oftwo FP multipliers, an FP adder, a transcendental unit, and an ALU. Thefloating point operations are done using 36-bit numbers (similar to IEEEbut with an extra 4 mantissa bits). Dual mathematical instructions canbe issued so multiple paths exist between the arithmetic elements, theinput storage elements, and the output storage elements.

Vertex Generator Unit 1B105 holds a 16-entry vertex cache and implementsthe vertex machinery to associate the stream of processed vertices withthe primitive type. When enough vertices for the given primitive typehave been received, a GeomPoint, GeomLine, or GeomTriangle message isissued. Clipped primitives have their intermediate vertices calculatedhere using the barycentric coordinates from clipping and thepost-shading parameter data. Flat shading, line stipple, and cylindricaltexture wrapping are also controlled here.

Viewport Transform Unit 1B107 perspectively divides the (selected)vertex parameters, and viewport maps the coordinate data.

Polygon Mode Unit 1B108 decomposes the input triangle or quad primitivesinto points and/or lines as needed to satisfy OpenGL's polymodeprocessing requirements.

The context data for the T&L subsystem is stored in the context recordby Bin Manager Unit 1A113.

Binning Subsystem

Binning Subsystem 1A110 is largely passive when binning is not enabled,and the messages just flow through; however, it does convert thecoordinates to be screen relative. Stippled lines are decomposed, andvertex parameters are still intercepted and forwarded to the PF Cache1C118 to reduce message traffic through the rest of the system. Thefollowing description assumes binning is enabled.

Binning Subsystem 1A110 is shown in the FIG. 1C.

Bin Setup Unit 1C111 takes the primitive descriptions (the Render*messages) together with the vertex positions and prepares the primitivefor rasterization. For triangles, this is simple as the trianglevertices are given, but for lines and points, the vertices of therectangle or square to be rasterized must be computed from the inputvertices and size information. Stippled lines are decomposed into theirindividual segments as these are binned separately. Binning andrasterization occur in screen space so the input window-relativecoordinates are converted to screen space coordinates here.

Bin Rasterizer Unit 1C112 takes the primitive description prepared bythe Bin Setup Unit and calculates the bins that a primitive touches. Abin can be viewed as a ‘fat’ pixel as far as rasterization is concernedas it is some multiple of 32 pixels in width and height. The rasterizeruses edge functions and does an inside test for each corner of thecandidate bin to determine if the primitive touches it. The primitiveand the group of bins that it touches are passed to Bin Manager Unit1C113 for processing. The bin seeking accurately tracks the edges of theprimitive for aliased rendering; however, antialiased rendering cansometimes include bins not actually touched by the primitive (this is aslight inefficiency but doesn't cause any problems downstream).

Bin Manager Unit 1C113 maintains a spatial database in memory thatdescribes the current frame being built while Bin Display Unit 1C114 isrendering the previous frame. All writes to memory go via Bin WriteCache 1C115. The database is divided between a Vertex Buffer and a BinRecord Buffer. The vertex buffer holds the vertex data (coordinate andparameters), and these are appended to the buffer whenever they arrive.The buffer works in a pseudo circular buffer fashion and is usedcollectively by all the bins. The Bin Record Buffer is a linked list ofbin records with one linked list per bin region on the screen (up to256) and holds state data as well as primitive data. A linked list isused because the number of primitives per bin region on the screen canvary wildly. When state data is received, it is stored locally until aprimitive arrives. When a primitive arrives, the bin(s) is checked tosee if any state has changed since the last primitive was written to thebin, and the bin updated with the changed state. Compressed pointers tothe vertices used by a primitive are calculated and, together with theprimitive details, are appended to the linked list for this bin.

Bin Manager Unit 1C113 only writes to memory, and Bin Write Cache 1A115handles the traditional cache functions to minimize memory bandwidth andread/modify/write operations as many of the writes will only updatepartial memory words.

Bin Manager Unit 1C113 also can be used as a conduit for vertex data tobe written directly to memory to allow the results of one vertex shaderto be fed back into a second vertex shader and can be used, for example,for surface tessellation. The same mechanism can also be used to loadmemory with texture objects and programs.

Bin Display Unit 1C114 will traverse the bin record linked list for eachbin and parse the records, thereby recreating the temporal stream ofcommands this region of the screen would have seen had there been nobinning. Prior to doing the parsing, the initial state for the bin issent downstream to ensure all units start in the correct state. Parsingof state data is simple—it is just packaged correctly and forwarded.Parsing primitives is more difficult as the vertex data needs to berecovered from the compressed vertex pointers and sent on before theprimitive itself. Only the coordinate data is extracted at thispoint—the parameter data is handled later, after primitive visibilityhas been determined. A bin may be parsed several times to supportdeferred rendering, stochastic super sampling, and order-independenttransparency. Clears and multi-sampling filter operations can also bedone automatically per bin.

The second half of the binning subsystem is later in the pipeline, butis described now.

Overlap Unit 1C116 is basically a soft FIFO (i.e. if the internalhardware FIFO becomes full, it will overflow to memory) and providesbuffering between Visibility Subsystem 1A160 and Fragment Subsystem1A170 to allow the visibility testing to run on ahead and not getstalled by fragment processing. This is particularly useful whendeferred rendering is used as the first pass produces no fragmentprocessing work so could be hidden under the second pass of the previousbin. Tiles are run-length encoded to keep the memory bandwidth down.

The Parameter Fetch (PF) Units will fetch the binned parameter data fora primitive if, and only if, the primitive has passed visibility testing(i.e. at least one tile from the primitive is received in the PFSubsystem). This is particularly useful with deferred rendering where inthe first pass everything is consumed by the Visibility Subsystem. ThePF Units are also involved in loading texture object data (i.e. thestate to control texture operations for one of the 32 potentially activetexture maps) and can be used to load programs from memory into PixelSubsystem 1A190 (to avoid having to treat them as tracked state whilebinning).

PF Address Unit 1C117 calculates the address in memory where theparameters for the vertices used by a primitive are stored and makes arequest to PF Cache 1C118 for that parameter data to be fetched. Theparameter data will be passed directly to PF Data Unit 1C119. It alsowill calculate the addresses for texture objects and pixel programs.

PF Data Unit 1C119 will convert the parameter data for the vertices intoplane equations and forward these to Fragment Subsystem 1A170 (overtheir own private connection). For 2D rendering, planes can also be setup directly without having to supply vertex data. The texture objectdata and pixel programs also are forwarded on the message stream.

Rasterizer Subsystem

The Rasterizer subsystem consists of a Primitive Setup Unit, aRasterizer Unit and a Rectangle Rasterizer Unit.

Rectangle Rasterizer Unit 1A120, as the name suggests, will onlyrasterize rectangles and is located in the isochronous stream. Therasterization direction can be specified.

Primitive Setup Unit 1A130 takes the primitive descriptions (the Render*messages) together with the vertex positions and prepares the primitivefor rasterization. This includes calculating the area of triangles,splitting stippled lines (aliased and antialiased) into individual linesegments (some of this work has already been done in Bin Setup Unit1C111), converting lines into quads for rasterization, converting pointsinto screen-aligned squares for rasterization and AA points to polygons.Finally, it calculates the projected x and y gradients from the floatingpoint coordinates to be used elsewhere in the pipeline for calculatingparameter and depth gradients for all primitives.

The xy coordinate input to Rasterizer Unit 1A140 is 2's complement 15.10fixed point numbers. When a Draw* command is received, the unit willthen calculate the 3 or 4 edge functions for the primitive type,identify which edges are inclusive edges (i.e. should return inside if asample point lies exactly on the edge; this needs to vary depending onwhich is the top or right edge so that butting triangles do not write toa pixel twice) and identify the start tile.

Once the edges of the primitive and a start tile are known, therasterizer seeks out screen-aligned super tiles (32×32 pixels) which areinside the edges or intersect the edges of the primitive. (In a dual P20system, only those super tiles owned by a rasterizer are visited.) Supertiles that pass this stage are further divided into 8×8 tiles for finertesting. Tiles that pass this second stage will be either totally insideor partially inside the primitive. Partial tiles are further tested todetermine which pixels in the tile are inside the primitive, and a tilemask is built up. When antialiasing is enabled, the partial tiles aretested against the user-defined sample points to build up the coverage(mask or value) for each pixel in the tile.

The output of the rasterizer is the Tile message which controls the restof the core. Each Tile message holds the tile's coordinate and tile mask(among other things). The tiles are always screen-relative and arealigned to tile (8×8 pixel) boundaries. Before a Tile message is sent,it is optionally scissored and masked using the area stipple pattern.The rasterizer will generate tiles in an order that maximizes memorybandwidth by staying in page as much as is possible. Memory is organizedin 8×8 tiles, and these are stored linearly in memory. (A 16×4 layout inmemory is also supported as this is more suitable for video display, butthis is largely hidden from most of the core units (some of the addressand cache units need to take it into account)).

The rasterizer has an input coordinate range of ±16K, but after visiblerectangle clipping, this is reduced to 0 . . . 8K. This can becommunicated to the other units in 10-bit fields for x and y as thebottom 3 bits can be omitted (they are always 0). Destination tiles arealways aligned as indicated above, but source tiles can have anyalignment (they are read as textures).

Context Unit

The isochronous stream and the main stream join into a common stream atContext Unit 1A145. Context Unit 1A145 will arbitrate between both inputstreams and dynamically switch between them. This switching to theisochronous stream normally occurs when the display reaches auser-defined range of scanlines. Before the other stream can take over,the context of the current stream must be saved, and the context for thenew stream restored. This is done automatically by Context Unit 1A145without any host involvement and takes less than 3 uS.

As state or programs for the downstream units pass through Context Unit1A145, it snoops the messages and writes the data to memory. In order toreduce the memory bandwidth, the context data is staged via a smallcache. The allocation of tags has been done carefully so messages withcommon widths are grouped together and segregated from transient data.High-frequency transient data such as vertex parameters are not contextswitched as any isochronous rendering will set up the plane equationsdirectly rather than via vertex values.

Context Unit 1A145 will only switch the context of units downstream fromit. A full context switch (as may be required when changing from oneapplication to another) is initiated by the driver using theChangeContext message (or may happen automatically due to the circularbuffer scheduling). The context saving of upstream units prior to BinManager Unit 1C113 are handled by Bin Manager Unit 1C113 (to prevent T&Lstate updates from causing premature flushing when binning) Unitsbetween Bin Manager Unit 1C113 and Context units will dump their contextout, often using the same messages which loaded it in the first place,which Context Unit 1A145 will intercept and write out to memory. TheContext Restore Unit (in the GPIO) will fetch the context data for theupstream units (loaded using their normal tags) while Context Unit 1A145will handle the downstream units. A full context switch is expected totake less than 20uS.

The isochronous stream has its own rasterizer. This rasterizer can onlyscan convert rectangles and is considerably simpler and smaller than themain rasterizer. Using a second rasterizer avoids the need to contextswitch the main rasterizer part way through a primitive which is verydesirable as it is heavily pipelined with lots of internal state.

WID Subsystem

The WID (window ID) subsystem 1A150 basically handles pixel-levelownership testing when the shape of windows or the overlapping ofwindows is too complicated to be represented by the window clippers inRasterizer Unit 1A140. The WID buffer (8-bits deep) also is used by theVideo Subsystem to control per window double-buffering and color tableselection.

The block diagram of the WID subsystem is shown in FIG. 1D.

The subsystem operates in one of two modes:

Pixel Ownership mode. In this mode, the Tile message is modified toremove any pixels not owned by this context.

Directed Buffer mode. The pixels being displayed are a composite of upto 4 buffers, depending on the front/back and stereo state of eachwindow. A 2D GDI operation has no idea about this and just wants toupdate the displayed pixels. In this mode, the Tile message is sent foreach active buffer with the tile mask reduced to just include thosepixels being displayed from that specific buffer (obviously no messageis sent if no pixels are being displayed).

WID Address Unit 1D151 calculates the address of the tile in the WIDbuffer and requests it from WID Cache 1D152. When WID testing isenabled, a Clear command is expanded into ClearTile commands for theclear region so WID testing can be applied to the individual tiles.

WID Cache 1D152, on a miss, will request the tile from memory and, whenit is loaded, will do the Pixel Ownership test (assuming this is themode of operation) and store the results of the test in the cache.Storing the test result instead of the WID values allows the cache to be8 times smaller. The cache is organized as 8 super tiles (or 8K pixels)and is read-only so never needs to write stale data back to memory.

WID Data Unit 1D153 does little more than AND the result mask with thetile mask when pixel ownership testing is enabled. For directed buffertesting, it gets WID values for each pixel in the tile and constructs upto 4 Tile messages depending on which buffer(s) each pixel is beingdisplayed in and sends them downstream with the appropriate color bufferselectors.

Visibility Subsystem

Visibility Subsystem 1A160 allows visibility (i.e. depth) testing to bedone before shading so the (expensive) shading can be avoided on anyfragments that will be immediately discarded.

The block diagram is shown in FIG. 1E.

Visibility Subsystem 1A160 replaces the router found in early chips thatreordered the pipeline to get this same effect. Having a separatesubsystem is more expensive than the router but has some significantadvantages:

The router system had to be changed to be in fragment-depth orderwhenever alpha-testing was enabled so the early depth test was lost. Nowthe early depth test can be enabled in all cases, even if the visibilitybuffer cannot be updated in some modes.

The visibility testing happens at the fragment level and not at thesample level so the test rate does not decrease when antialiasing.

Conservative testing allows some shortcuts to be made that enhancesperformance without increasing gate cost.

It helps with the deferred rendering operation (when binning) as thefirst pass can be done really fast and produces no message output. Thisfirst pass can often be overlapped with the fragment shading of theprevious bin

It simplifies physical layout.

Vis Address Unit 1E161 calculates the address of the tile in thevisibility buffer and issues this to Vis Cache Unit 1E162. Some commandssuch as Clear are also ‘rasterized’ locally.

Visibility Setup Unit 1E163 takes the coordinate information for theprimitive (that the tile belongs to) and the derivative informationprovided by Primitive Setup Unit 1A130 and calculates the plane equationvalues (origin, dzdx, and dzdy gradients) for the depth value. These arepassed to the Vis Data Unit 1E164 so the depth plane equation can beevaluated across the tile.

The Vis Cache holds 8 super tiles of visibility information and willread memory when a cache miss occurs. The miss also may cause a supertile to be written back to memory (just the enclosed tiles that havebeen dirtied). The size of the cache allows a binned region to be 128×64pixels in size and normally no misses would occur during binning.Additional flags are present per tile to assist in order-independenttransparency and edge tracking. The visibility buffer is a reducedspatial resolution depth buffer where each 4×4 sub tile is representedby a single-depth value (or two when multi-sample edge tracking to allowedges caused by penetrating faces to be detected). The lower spatialresolution reduces the cache size by 16× and allows a whole 8×8 tile tobe checked with a modest amount of hardware. All of the data needed toprocess a tile are transferred in a single cycle to/from Vis Data UnitIE 164.

Vis Data Unit IE 164 uses the plane equation generated by Vis Setup Unit1E163 and the vis buffer data provided by Vis Cache 1E162 for this tileto check if any of the 4×4 sub tiles are visible. Just the corners ofeach sub tile are checked, and only if all the corners are not visiblewill the sub tile be removed from the original tile. (A consequence ofthis is that a surface made up from small (i.e. smaller than a sub tile)primitives will not obscure a further primitive, even with front to backrendering.). When binning and multi-sampling, the minimum and maximumdepth values per sub tile are held in the visibility buffer (for edgetracking) so that only those sub tiles with edges need to bemulti-sampled. A local tile store is updated with the results, and thisacts as an L0 cache to Vis Cache IE 162 to avoid the round tripread-after-write hazard synchronization when successive primitives hitthe same tile.

Fragment Subsystem

The Fragment Subsystem consists of the Fragment Shading Unit, theFragment Cache, the Texture Filter Arbiter and two Filter Pipes.

The block diagram is shown in FIG. 1F.

The n fragment subsystems are replicated to achieve the desiredperformance. Logically, the subsystems are organized in parallel witheach one handling every n^(th) tile; however, the physical routing ofthe fan-out and fan-in networks makes this hard to do without excessivecongestion. This is solved by daisy-chaining the fragment shaders inseries and using suitable protocols to broadcast plane information,common state, to distribute work fairly and ensure the tile's resultsare restored to temporal order. From a programmer's viewpoint, thereonly appears to be one fragment subsystem.

The fragment subsystem is responsible for calculating the color offragments, and this can involve arbitrary texture operations andcomputations for 2D and 3D operations. All blits are done as textureoperations. (Pixel Subsystem 1A190 can do screen-aligned blits (i.e.copy from the back buffer to the front buffer); however, using textureoperations should allow more efficient streaming of data.)

Fragment Shading Unit 1F171 will run a program (or shader) up to 4 timeswhen it receives a Tile message—i.e. once per active sub tile.Typically, a shader will calculate a texture coordinate from some planeequations and maybe global data, request a texture access from one ofthe Filter Pipes, and when the texel data is returned combine it withother planes, values, or textures to generate a final color. The finalcolor is sent as fragment data to Pixel Subsystem 1A190. A key part ofthe design of Fragment Shading Unit IF 171 is its ability to cope withthe long latency from making a texture request to the results arrivingback. This is done by running multithreads—each sub tile's shader is runas a separate thread, and when the thread accesses a resource that isnot ready (the texture result is one such example), the thread issuspended, and the next available thread run. This way, thecomputational resources are kept busy, but given the short length ofmany of the shaders, the cost of thread-switching must be lightweight toallow switching every few cycles. Thread-switching does not involve anycontext save and restore operations—the registers used by each threadare unique and not shared. It is too expensive to provide each threadwith a maximal set of resources (i.e. registers) so the resources aredivided up among the threads, and the number of threads depends on theresource complexity of the shader. There can be a maximum of 16 threads,and they can work on one or more primitives.

Fragment Shading Unit IF 171 is an SIMD architecture with 16 scalar PEprocessors. Vector instructions can be efficiently encoded, and the mainarithmetic elements include a floating point adder and a floating pointmultiplier. More complex arithmetic operations such as divide, power,vector magnitude, etc. are computed in the Filter Pipe. Formatconversion can be done in-line on received or sent data. Theinstructions and global data are cached, and data can be read andwritten to memory (with some fixed layout constraints) so a variablestack is supported, thereby arbitrary, long, and complex programs to beimplemented. Multi-word (and format) fragment data can be passed toPixel Subsystem 1A190, and depth and/or stencil values generated for SDSubsystem 1A180.

Fragment Cache Unit 1F172 provides a common path to memory wheninstruction or global cache misses occur (the actual caches for theseare part of Fragment Shading Unit 1F171) and a real cache for generalmemory accesses. These memory accesses are typically for variablestorage on a stack, but can also be used to read and write buffers fornon Tile based work.

Texture Filter Arbiter 1F173 will distribute texture and computerequests amongst multiple Filter Pipes (two in this case) and collatethe results. Round robin distribution is used.

Fragment Mux Unit 1F175 takes the fragment data stream and messagestream from the last Fragment Shading Unit and generates a fragmentstream to the SD Data Unit 1H183, Pixel Data Unit 11192, and a messagestream to SD Address Unit 1H181.

Filter Pipe Subsystem

The main job of Filter Pipe Subsystem 1A170 is to take commands fromFragment Shading Unit IF 171 and do the required texture access andfiltering operations. Much of the arithmetic machinery can also be usedfor evaluating useful, but comparatively infrequent, mathematicaloperations such as reciprocal, inverse square root, log, power, vectormagnitude, etc.

Texture LOD Unit 1G171's main job is to calculate the perspectivelycorrect texture coordinates and level of detail for the fragments passedfrom Fragment Shading Unit 1F171. The commands are for a sub tile'sworth of processing so the first thing that is done is to serialize thefragments so the processing in this unit and the rest of the filter pipeis done one fragment at a time. Local differencing on 2×2 groups offragments is done to calculate the partial derivatives and hence thelevel of detail.

Texture Index Unit 1G172 takes the u, v, w, LOD and cube faceinformation for a fragment from the Texture LOD Unit 1G171 and convertsit into the texture indices (i, j, k) and interpolation coefficientsdepending on the filter and wrapping modes in operation. Texture indicesare adjusted if a border is present. The output of this unit is a recordwhich identifies the 8 potential texels needed for the filtering, theassociated interpolation coefficients, map levels, and a face number.

Primary Texture Cache Unit 1G173 uses the output record from TextureIndex Unit 1G172 to look up in its cache directory whether the requiredtexels are already in the cache and if so where. Texels which are not inthe cache are passed to the request daisy chain so they can be read frommemory (or the secondary cache) and formatted. The read texture datapasses through this unit on the way to Texture Filter Unit 1G174 (wherethe data part of the cache is held) so the expedited loading can bemonitored and the fragment delayed if the texels it requires are notpresent in the cache. Expedited loading of the cache and FIFO buffering(between the cache lookup and dispatch operations) allows for thelatency for a round trip to the secondary cache without any degradationin performance; however, secondary cache misses will introduce stalls.(It is very likely that some texture access patterns (bilinearminification, for example) or simultaneous misses in all texture pipeswill also cause some stalls. The impact of these could be reduced bymaking the latency FIFO deeper.)

The primary cache is divided into two banks, and each bank has 16 cachelines, each holding 16 texels in a 4×4 patch. The search is fullyassociative, and 8 queries per cycle (4 in each bank) can be made. Thereplacement policy is LRU, but only on the set of cache lines notreferenced by the current fragment or fragments in the latency FIFO. Thebanks are assigned so even mip map levels or 3D slices are in one bankwhile odd ones are in the other. The search key is based on the texel'sindex and texture ID, not addresses in memory (saves having to compute 8addresses). The cache coherency is intended only to work within a subtile or maybe a tile, and never between tiles. (Recall that the tilesare distributed between pipes so it is very unlikely adjacent tiles willend up in the same texture pipe and hence Primary Texture Cache Unit1G173.)

Texture Filter Unit 1G174 holds the data part of the primary texturecache in two banks and implements a trilinear lerp between the 8 texelssimultaneously read from the cache. The texel data is always in 32-bitcolor format, and there is no conversion or processing between the cacheoutput and lerp tree. The lerp tree is configured between the differentfilter types (nearest, linear, ID, 2D, and 3D) by forcing the 5interpolation coefficients to be 0.0, 1.0 or taking their real value.The filtered results can be further accumulated (with scaling) toimplement anisotropic filtering before the final result is passed backto Fragment Shading Unit IF 171 (via Texture Filter Arbiter IF 173).

Texture Infrastructure

The commands and state data (texture object data) arrive at the TextureAddress Unit via a request daisy chain that runs through all the TexturePrimary Cache Units. The protocol on the request chain ensures allfilter pipes are fairly served, and correct synchronization enforcedwhen global state is changed.

The block diagram is shown in FIG. 1G.

Texture Address Unit 1G175 calculates the address in memory where thetexel data resides. This operation is shared by all filter pipes (tosave gates by not duplicating it), and in any case, it only needs tocalculate addresses as fast as the memory/secondary cache can servicethem. The texture map to read is identified by a 5-bit texture ID, itscoordinate (i, j, k), a map level, and a cube face. This together withlocal registers allows a memory address to be calculated. This unit onlyworks in logical addresses, and the translation to physical addressesand handling any page faulting is done in the Memory Controller. Theaddress of the texture map at each mip map level is defined by softwareand held in the texture object descriptor. The maximum texture map sizeis 8K×8K, and they do not have to be square (except for cube maps) andcan be any width, height or depth. Border colors are converted to amemory access as the border color for a texture map is held in thememory location just before the texture map (level 0).

Once the logical address has been calculated, it is passed on toSecondary Texture Cache Unit 1G176. This unit will check if the texturetile is in the cache and if so will send the data to Texture Format Unit1G177. If the texture tile is not present, then it will issue a requestto the Memory Controller and, when the data arrives, update the cacheand forward the data on. The cache lines hold a 256-byte block of data,and this would normally represent an 8×8 by 32 bpp tile, but could besome other format (8 or 16 bpp, YUV, or compressed). The cache is 4-wayset associative and holds 64 lines (i.e. for a total cache size of 16Kbytes), although this may change once some simulations have been done.Cache coherence with the memory is not maintained, and it is up to theprogrammer to invalidate the cache whenever textures in memory areedited. Secondary Texture Cache 1G176 capitalizes on the coherencybetween tiles or sub tiles when more than one texture is being accessed.

Texture Format Unit 1G177 receives the raw texture data from TextureSecondary Cache Unit 1G176 and converts it into the single, fixed-formatTexture Filter Unit 1G174 works in (32 bpp 4×4 sub tiles). As well ashandling the normal 1, 2, 3, or 4-component textures held as 8, 16, or32 bits, it also does YUV 422 conversions (to YUV 444) and expands theDX-compressed texture formats. Indexed (palette) textures are nothandled directly but are converted to one of the texture formats whenthey are downloaded.

The formatted texel data is distributed back to the originator of therequest via the data daisy chain that runs back through all the filterpipes. If a filter pipe does not match as the original requester, itpasses on the data, otherwise it removes it from the data chain.

The daisy chain method of distributing requests is used because itsimplifies the physical layout of the units on the die and reduceswiring congestion.

SD Subsystem

SD Subsystem 1A180 is responsible for the depth and stencil processingoperations. The depth value is calculated from the plane equation foreach fragment (or each sample when multi sample antialiasing), or can besupplied by Fragment Shading Unit 1F171.

A block diagram of SD Subsystem 1A180 is shown in FIG. 1H.

SD Address Unit 1H181, in response to a SubTile message, will generate atile/sub tile addresses and pass this to SD Cache 1H182. Whenmulti-sample antialiasing is enabled, each sample will have its tile/subtile address-generated and also output a SubTile message. All addressesare aligned on tile boundaries. SD Address Unit 1H181 will generate aseries of addresses for the Clear command and also locally expandFilterColor and MergeTransparencyLayer commands when binning (ifnecessary).

SD Cache 1H182 has 8 cache lines, and each cache line can hold ascreen-aligned super tile (32×32). The super tile may be partiallypopulated with tiles, and the tiles are updated on a sub tilegranularity. Flags per sub tile control fast clearing andorder-independent transparency operations. The cache size is dictated bybinning—the larger the better, but practical size constrains limit us to128×64 pixels for aliased rendering or 32×32 pixels when 8 sample multisampling is used. The fast clear operation sets all the fast clear flagsin a super tile in one cycle (effectively clearing 4K bytes), and SDData Unit 1H183 will substitute the clear value when a sub tile isprocessed. SD Data Unit 1H183 also will merge the old and new fragmentvalues for partial sub tile processing.

SD Setup Unit 1H184 takes the coordinate information for the primitive(that the sub tile belongs to), the sample number, and the derivativeinformation provided by Primitive Setup Unit 1A130 and calculates theplane equation values (origin, dzdx, and dzdy gradients) for the depthvalue. These are passed to SD Data Unit 1H183 so the depth planeequation can be evaluated across the sub tile. The sample number (whenmulti sampling) selects the jittered offset to apply to the planeorigin. [0232] SD Data Unit 1H183 implements the standard stencil anddepth processing on 16 fragments (or samples) at a time. The SD bufferpixels are held in byte planar format in memory and are always 32-bitsdeep. Conversion to and from the external format of the SD buffer isdone in this unit. The updated fragment values are written back to thecache, and the sub tile mask modified based on the results of the tests.Data is transferred for the 16 fragments 32 bits at a time to boost thesmall primitive processing rate.

Pixel Subsystem

Pixel Subsystem 1A190 is responsible for combining the color calculatedin Fragment Shading Unit 1F171 with the color information read from theframe buffer and writing the result back to the frame buffer. Itssimplest level of processing is a straight replace but could includeantialiasing coverage, alpha blending, dithering, chroma-keying, andlogical operations. More complex operations such as deeper pixelprocessing, accumulation buffer operations, multi-buffer operations, andmulti-sample filtering can also be done.

A block diagram of Pixel Subsystem 1A190 is shown in FIG. 1I.

Pixel Address Unit 11191, in response to a SubTile message, willgenerate a number of tile addresses. Normally, this will be a singledestination address, but could be multiple addresses for deep pixel ormore advanced processing. The generation of addresses and the initiationof program runs in Pixel Data Unit 11192 are controlled by a small userprogram. All addresses are aligned on tile boundaries. Pixel AddressUnit 11191 will generate a series of address for the Clear command andalso locally expand FilterColor and MergeTransparencyLayer commands whenbinning (if necessary). Download data is synchronized here, andaddresses automatically generated to keep in step.

Pixel Cache 11193 is a subset of SD Cache 1H182 (see earlier). PixelCache 11193 lacks the flags to control order-independent transparency,but has a 64-bit wide clear value register (to allow 64-bit colorformats). Partial sub tile updates are handled by merging the old andnew data in Pixel Data Unit 11192.

The heart of this subsystem is Pixel Data Unit 11192. This is a 4×4 SIMDarray of float 16 processors. The interface to Pixel Cache 11193 is adouble-buffered, 32-bit register, and the fragment data interface is aFIFO-buffered, 32-bit register per SIMD element. The tile mask can beused and tested in the SIMD array, and the program storage (128instructions) is generous enough to hold a dozen or so small programs.Programs will typically operate on one component at a time; however, tospeed up the straight replace operation, a ‘built-in’ Copy program canbe run that will copy 32 bits at a time. Pixel data received from PixelCache 11193 can be interpreted directly as byte data or as float 16. Noother formats are supported directly, but they can be emulated (albeitwith a loss of speed) with a suitable program in the SIMD array.

In order to support some of the more complex operations such asmulti-buffer, accumulation buffering, multi-sample filtering, etc.,several programs can be run on the same tile with different frame bufferand global data before the destination tile is updated. The fragmentcolor data can be held constant for some passes or changed, and eachpass can write back data to Pixel Cache 11193. Each SubTile message hasan extra field to indicate which tile program (out of 8) to run and afield which holds the pass number (so that filter coefficients, etc. canbe indexed). Any data to be carried over from one pass to the next isheld in the local register file present in each SIMD element. Typically,the first tile program will do some processing (i.e. multiply the framebuffer color with some coefficient value) and store the results locally.The middle tile program will do the same processing, maybe with adifferent coefficient value, but add to the results stored locally. Thelast tile program will do the same processing, add to the results storedlocally, maybe scale the results and write them to Pixel Cache 11193.Multi-buffer and accumulation processing would tend to run the sameprogram for each set of input data.

Data being transferred into or out of the SIMD array is done 32 bits ata time so the input and output buses connected to Pixel Cache 11193 are512 bits each. A small (4 entry) L0 cache is held in Pixel Data Unit11192 so the round trip via Pixel Cache 11193 is not necessary forclosely repeating sub tiles.

Host Out Unit

Host Out Unit 1A195 takes data forwarded on by Pixel Subsystem 1A190 viathe message stream to be passed back to the host. Message filtering isdone on any message reaching this point other than an upload datamessage; a sync message or a few other select messages are removed andnot placed in the output FIFO. Statistics gathering and profile messageprocessing can be done, and the results left directly in the host'smemory.

FIG. 1J is an overview of a computer system, with a video displayadapter 445 in which the embodiments of the present inventions canadvantageously be implemented. The complete computer system includes inthis example: user input devices (e.g. keyboard 435 and mouse 440); atleast one microprocessor 425 which is operatively connected to receiveinputs from the input devices, across e.g. a system bus 431, through aninterface manager chip 430 which provides an interface to the variousports and registers; the microprocessor interfaces to the system busthrough perhaps a bridge controller 427; a memory (e.g. flash ornon-volatile memory 455, RAM 460, and BIOS 453), which is accessible bythe microprocessor; a data output device (e.g. display 450 and videodisplay adapter card 445) which is connected to output data generated bythe microprocessor 425; and a mass storage disk drive 470 which isread-write accessible, through an interface unit 465, by themicroprocessor 425.

Optionally, of course, many other components can be included, and thisconfiguration is not definitive by any means. For example, the computermay also include a CD-ROM drive 480 and floppy disk drive (“FDD”) 475which may interface to the disk interface controller 465. Additionally,L2 cache 485 may be added to speed data access from the disk drives tothe microprocessor 425, and a PCMCIA 490 slot accommodates peripheralenhancements. The computer may also accommodate an audio system formultimedia capability comprising a sound card 476 and a speaker(s) 477.

According to a disclosed class of innovative embodiments, there isprovided: A method for rendering 3D graphics, comprising the steps of:a) separating a display space into multiple bins, each containingmultiple pixels of said display space; b) for each of said bins,defining multiple respective sub-bins such that the size of said bin isa multiple of the size of said respective sub-bins; c) generating adatabase which shows which primitives affect respective ones of saidbins, but does not identify which sub-bins are affected within anaffected one of said bins; and d) traversing respective sub-bins d1)using said database to identify which primitives affect the bin whichcontains said respective sub-bin, and also d2) using an additional testto identify which of the primitives identified in said step d1 affectsaid respective sub-bin.

According to a disclosed class of innovative embodiments, there isprovided: A rendering method, comprising the steps of: a) separating adisplay space into multiple bins, each said bin containing multiplesub-bins, and each said sub-bin containing multiple pixels; and b)repeatedly rendering bins of said display space, using, for each saidbin, only primitives which affect said bin; wherein a single iterationof said step b), for at least one of said bins, comprises iterativerendering of respective sub-bins of said bin; and wherein said renderingof a single respective sub-bin comprises traversal of said bin, whileignoring primitives which do not affect said respective sub-bin.

According to a disclosed class of innovative embodiments, there isprovided: A method for rendering transformed three-dimensionalprimitives, comprising: a) a step for separating a display space intomultiple bins, each said bin containing multiple sub-bins, and each saidsub-bin containing multiple pixels; b) a step for preparing a databasewhich identifies, for ones of said bins, which of the primitives affectsaid respective bin, but which does not separately identify which of theprimitives affects particular sub-bins within said respective bin; andc) a step for repeatedly rendering said sub-bins of said display space,using, for each said sub-bins, all primitives which have beenidentified, in said database, as affecting the bin to which saidrespective sub-bin belongs.

According to a disclosed class of innovative embodiments, there isprovided: A rendering method, comprising the steps of: a) separating adisplay space into multiple bins, each said bin containing multiplesub-bins, and each said sub-bin containing multiple pixels; b) recordingwhich bins are touched or affected for each primitive in the display, c)creating a database of the primitives to be rendered in each bin fromthe information generated in step b); and d) for each bin touched oraffected by a primitive, processing all sub-bins which fall within saidrespective bin.

According to a disclosed class of innovative embodiments, there isprovided: A method for 3D graphics rendering, comprising the steps of:a) separating a display space into bins, each containing multiple pixelsof said display space; b) for each of said bins, defining multiplerespective sub-bins such that the size of said bin is a multiple of thesize of said respective sub-bins; c) traversing respective sub-bins c1)using said database to identify which primitives affect the bin whichcontains said respective sub-bin, and also c2) using a bounding box testto identify which of the primitives identified in said step c1 affectsaid respective sub-bin; and d) using the results of said bounding boxtest to d1) discard primitives that are outside of the current sub-binbeing processed; and d2) read in the parameters associated with everyvertex that affects the current sub-bin.

According to a disclosed class of innovative embodiments, there isprovided: A computer system for 3D graphics rendering comprising: a hostprocessor; and a 3D graphics accelerator comprising: a device for a)separating a display space into multiple bins, each containing multiplepixels of said display space; b) for each of said bins, definingmultiple respective sub-bins such that the size of said bin is amultiple of the size of said respective sub-bins; and c) generating adatabase which shows which primitives affect respective ones of saidbins, but does not identify which sub-bins are affected within anaffected one of said bins.

According to a disclosed class of innovative embodiments, there isprovided: A graphics rendering module, comprising: multiple databasebins, each containing multiple pixels of a display space; for each ofsaid bins, multiple respective sub-bins such that the size of said binis a multiple of the size of said respective sub-bins; and a device fortraversing respective sub-bins using a database to identify whichprimitives affect the bin which contains said respective sub-bin, andalso using an additional test to identify which of the primitivesidentified affect said respective sub-bin.

According to a disclosed class of innovative embodiments, there isprovided: A graphics rendering architecture, comprising: a) a means forseparating a display space into multiple bins, each said bin containingmultiple sub-bins, and each said sub-bin containing multiple pixels; andb) a means for repeatedly rendering bins of said display space, using,for each said bin, only primitives which affect said bin; wherein asingle iteration of said means b), for at least one of said bins,comprises iterative rendering of respective sub-bins of said bin; andwherein said rendering of a single respective sub-bin comprisestraversal of said bin, while ignoring primitives which do not affectsaid respective sub-bin.

DEFINITIONS

Following are short definitions of the usual meanings of some of thetechnical terms which are used in the present application. (However,those of ordinary skill will recognize whether the context requires adifferent meaning) Additional definitions can be found in the standardtechnical dictionaries and journals.

A “primitive” or “fragment” is any fundamental geometric form, such as atriangle, used for building 3-D computer graphics.

Modifications and Variations

As will be recognized by those skilled in the art, the innovativeconcepts described in the present application can be modified and variedover a tremendous range of applications, and accordingly the scope ofpatented subject matter is not limited by any of the specific exemplaryteachings given.

Many of the requirements of 3D graphics processing are quite differentfrom those of earlier attempts to create computer graphics. However, asthe evolution of computers and of visual interfaces continues, it isexpected that many of the disclosed innovations will be directlyapplicable to systems which go beyond 3D graphics. For example, suchcontemplated further applications can include stereoscopic graphicssystems, systems which provide 4D processing (e.g. for motion filteringof video streams), and/or anamorphic image transformation.

In the presently preferred embodiment, a bounding box test is used todetermine if a primitive should be discarded. However, alternatively,and less preferably, other tests may be used.

Also, the present application uses a 4:1 ratio of sub-bins to whole binsas a sample embodiment. However, other less-preferable ratios may beused, such as 8:1 and 16:1.

In another class of embodiments, the display space is 1600×1200 pixels.Of course, other display space sizes are possible.

In another class of embodiments, the bins are 64×64 pixels. Of course,other bin sizes are possible.

Note that with regard to the disclosed inventions, a primitive can beany geometric form such as a line, a triangle, or a rectangle.

Note also that the disclosed inventions can be used with primitives thatare antialiased, as well as those that are not antialiased.

Additional general background, which helps to show variations andimplementations, may be found in the following publications, all ofwhich are hereby incorporated by reference: Advances in ComputerGraphics (ed. Enderle 1990); Angel, Interactive Computer Graphics: ATop-Down Approach with OpenGL; Angell, High-Resolution Computer GraphicsUsing C (1990); the several books of “Jim Blinn's Corner” columns;Computer Graphics Hardware (ed. Reghbati and Lee 1988); ComputerGraphics: Image Synthesis (ed. Joy et al.); Eberly: 3D Game EngineDesign (2000); Ebert: Texturing and Modelling 2.ed. (1998); Foley etal., Fundamentals of Interactive Computer Graphics (2.ed. 1984); Foley,Computer Graphics Principles & Practice (2.ed. 1990); Foley,Introduction to Computer Graphics (1994); Glidden: Graphics ProgrammingWith Direct3D (1997); Hearn and Baker, Computer Graphics (2.ed. 1994);Hill: Computer Graphics Using OpenGL; Latham, Dictionary of ComputerGraphics (1991); Tomas Moeller and Eric Haines, Real-Time Rendering(1999); Michael O'Rourke, Principles of Three-Dimensional ComputerAnimation; Prosise, How Computer Graphics Work (1994); Rimmer, BitMapped Graphics (2.ed. 1993); Rogers et al., Mathematical Elements forComputer Graphics (2.ed. 1990); Rogers, Procedural Elements For ComputerGraphics (1997); Salmon, Computer Graphics Systems & Concepts (1987);Schachter, Computer Image Generation (1990); Watt, Three-DimensionalComputer Graphics (2.ed. 1994, 3.ed. 2000); Watt and Watt, AdvancedAnimation and Rendering Techniques: Theory and Practice; Scott Whitman,Multiprocessor Methods For Computer Graphics Rendering; the SIGGRAPHProceedings for the years 1980 to date; and the IEEE Computer Graphicsand Applications magazine for the years 1990 to date. These publications(all of which are hereby incorporated by reference) also illustrate theknowledge of those skilled in the art regarding possible modificationsand variations of the disclosed concepts and embodiments, and regardingthe predictable results of such modifications.

None of the description in the present application should be read asimplying that any particular element, step, or function is an essentialelement which must be included in the claim scope: THE SCOPE OF PATENTEDSUBJECT MATTER IS DEFINED ONLY BY THE ALLOWED CLAIMS. Moreover, none ofthese claims are intended to invoke paragraph six of 35 USC section 112unless the exact words “means for” are followed by a participle.

What is claimed is:
 1. A method for rendering 3D graphics, comprising:separating a display space into multiple non-overlapping bins andsub-bins, each bin containing an integer multiple of sub-bins, eachsub-bin containing multiple pixels of said display space, wherein thedisplay space comprises primitives and displays only sub-bins;generating a database which shows which primitives affect respectiveones of said bins, but does not identify which respective sub-bins areaffected within an affected one of said bins, wherein the database onlyuses bins and not sub-bins; using said generated database to identifywhich of the primitives affect the bin which contains one of saidrespective sub-bins, and also, without using the database, separatelyidentifying which of the primitives identified affect said onerespective sub-bin, and painting pixels on a physical display apparatus,using only those primitives identified to represent said one respectivesub-bin.
 2. The method of claim 1, wherein said maximum number of binsis
 256. 3. The method of claim 1, wherein said display space is1600×1200 pixels.
 4. The method of claim 1, wherein said bins are 64×64pixels.
 5. The method of claim 1, wherein said primitive is a triangleor line.
 6. The method of claim 1, wherein said primitive may beantialiased or not.
 7. A device comprising: a processor and memory for:separating a display space into multiple non-overlapping bins andsub-bins, each bin containing an integer multiple of sub-bins, eachsub-bin containing multiple pixels of said display space, wherein thedisplay space comprises primitives and displays only sub-bins;generating a database which shows which primitives affect respectiveones of said bins, but does not identify which respective sub-bins areaffected within an affected one of said bins, wherein the database onlyuses bins and not sub-bins; using said generated database to identifywhich of the primitives affect the bin which contains one of saidrespective sub-bins, and also, without using the database, separatelyidentifying which of the primitives identified affect said onerespective sub-bin, and painting pixels on a physical display apparatus,using only those primitives identified to represent said one respectivesub-bin.
 8. The device of claim 7, wherein said maximum number of binsis
 256. 9. The device of claim 7, wherein said display space is1600×1200 pixels.
 10. The device of claim 7, wherein said bins are 64×64pixels.
 11. The device of claim 7, wherein said primitive is a triangleor line.
 12. The device of claim 7, wherein said primitive may beantialiased or not.
 13. A computer system for 3D graphics renderingcomprising: a host processor; a display; and a 3D graphics acceleratorcomprising: a device for separating a display space into multiplenon-overlapping bins and sub-bins, each bin containing an integermultiple of sub-bins, each sub-bin containing multiple pixels of saiddisplay space, wherein the display space comprises primitives anddisplays only sub-bins; generating a database which shows whichprimitives affect respective ones of said bins, but does not identifywhich respective sub-bins are affected within an affected one of saidbins, wherein the database only uses bins and not sub-bins; using saidgenerated database to identify which of the primitives affect the binwhich contains one of said respective sub-bins, and also, without usingthe database, separately identifying which of the primitives identifiedaffect said one respective sub-bin, and painting pixels on a physicaldisplay apparatus, using only those primitives identified to representsaid one respective sub-bin.
 14. The system of claim 13, wherein saidmaximum number of bins is
 256. 15. The system of claim 13, wherein saiddisplay space is 1600×1200 pixels.
 16. The system of claim 13, whereinsaid bins are 64×64 pixels.
 17. The system of claim 13, wherein saidprimitive is a triangle or line.
 18. The system of claim 13, whereinsaid primitive may be antialiased or not.